﻿<UserControl x:Class="BasketballRoster.View.RosterControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="300">

    <UserControl.Resources>
        <DataTemplate x:Key="PlayerItemTemplate">
            <TextBlock>
                <Run Text="{Binding Name}"/>
                <Run Text=" #"/>
                <Run Text="{Binding Number}"/>
            </TextBlock>
        </DataTemplate>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Border BorderThickness="2" BorderBrush="Blue" CornerRadius="6" Background="Black">
            <StackPanel Margin="20">
                <TextBlock Foreground="White" FontFamily="Segoe" FontSize="20px"
                           FontWeight="Bold" Text="{Binding TeamName}" />
                <TextBlock Foreground="White" FontFamily="Segoe" FontSize="16px" 
                           Text="Starting Players" Margin="0,5,0,0"/>
                <ListView Background="Black" Foreground="White"  Margin="0,5,0,0"
                                           ItemTemplate="{StaticResource PlayerItemTemplate}"
                                           ItemsSource="{Binding Starters}" />
                <TextBlock Foreground="White"  FontFamily="Segoe" FontSize="16px"
                           Text="Bench Players" Margin="0,5,0,0"/>
                <ListView Background="Black" Foreground="White" ItemsSource="{Binding Bench}" 
                          ItemTemplate="{StaticResource PlayerItemTemplate}" Margin="0,5,0,0"/>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>